<template>
  <div class="app-container">
    <transition name="el-zoom-in-center">
      <jobProject-list v-if="options.showList" @showCard="showCard"></jobProject-list>
    </transition>
    <transition name="el-zoom-in-top">
      <jobProject-add v-if="options.showAdd" :data="options.data" @showCard="showCard"></jobProject-add>
    </transition>
    <transition name="el-zoom-in-top">
      <jobProject-edit v-if="options.showEdit" :data="options.data" @showCard="showCard"></jobProject-edit>
    </transition>
    <transition name="el-zoom-in-bottom">
      <jobProject-detail v-if="options.showDetail" :data="options.data" @showCard="showCard"></jobProject-detail>
    </transition>
  </div>
</template>

<script>
import * as jobProjectApi from '@/api/integration/datax/datax-job-project'
import jobProjectAdd from './jobProjectAdd.vue';
import jobProjectEdit from './jobProjectEdit.vue';
import jobProjectDetail from './jobProjectDetail.vue';
import jobProjectList from './jobProjectList.vue';

export default {
  name: 'JobProject',
  components: { jobProjectAdd, jobProjectList, jobProjectEdit, jobProjectDetail },
  data() {
    return {
      options: {
        data: {},
        showList: true,
        showAdd: false,
        showEdit: false,
        showDetail: false
      }
    }
  },
  methods: {
    showCard(data) {
      Object.assign(this.options, data)
    }
  }
}
</script>
